﻿using System;
using System.Globalization;
using System.Windows.Data;
using Visiblox.Charts;

namespace StockAnalyst2.Converters
{
	public class BarValueConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			IDataPoint dataPoint = value as IDataPoint;

			if (dataPoint != null)
				return ((decimal)dataPoint[parameter]);

			return value;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}